package StudyCode.summary.BufferAndChannel;

import java.nio.ByteBuffer;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ByteBufferIsDirect {
	public static void main(String[] args) {
		ByteBuffer bbuf = ByteBuffer.wrap(new byte[10]);
		boolean isDirect = bbuf.isDirect(); // false
		System.out.println("isDirect?" + isDirect);
		bbuf = ByteBuffer.allocate(10);
		isDirect = bbuf.isDirect(); // false
		System.out.println("isDirect?" + isDirect);
		bbuf = ByteBuffer.allocateDirect(10);
		isDirect = bbuf.isDirect(); // true
		System.out.println("isDirect?" + isDirect);
	}
}
